import React, { Component } from 'react'
import Child from './views/Child'
export default class App extends Component {
  state={
    msg:'父组件中的数据',
    list:['张三','李四']
  }
  render() {
    return (
      <div>
        <h1>父组件</h1>
        <div>{this.state.msg}</div>
        <button onClick={()=>{
          this.setState(()=>{
            return{
              msg:'父组件的数据已经改过了'
                
            }
          })
        }}>修改数据</button>
        <Child pmsg={this.state.msg} list={this.state.list}></Child>
      </div>
    )
  }
}
